Absences: offset parameter does not match documentation#82
Open
sun wants to merge 1 commit intopersonio:masterfrom
Open
Absences: offset parameter does not match documentation#82sun wants to merge 1 commit intopersonio:masterfrom
sun wants to merge 1 commit intopersonio:masterfrom
Conversation
- The `offset` parameter is based on `1`. Passing `0` is automatically converted into `1` in the API. This results in duplicate response data when the client is counting up `$offset++`, as the client is first passing `0` then `1`. - The `offset` parameter indicates the "page" to retrieve, chunked by `limit`.
ypasmk
reviewed
Feb 10, 2022
| in: query | ||
| required: false | ||
| description: Pagination attribute to identify which page you are requesting, by the form of telling an offset from the first record that would be returned. | ||
| description: Pagination attribute to identify which page to request from the chunks indicated by `limit`. The value `0` is interpreted as page `1`. You cannot pass a value larger than the available amount of pages, as returned by the `total_pages` meta data in the response. |
Contributor
There was a problem hiding this comment.
Page 1 is also interpreted as page 1 right? Maybe we need to add that to make it more clear and explicit?
Contributor
|
I think documenting this is important. If it were not for this PR I would have wasted quite some time wondering why the pagination didn't work as expected from other endpoints. |
Author
|
Thanks for your feedback. I'll incorporate it into the PR next week. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
GET /company/time-offsparameteroffsetis documented as zero based and the wording "telling an offset from the first record that would be returned" suggests that it accepts an offset of records instead of pages.api-docs/personio-personnel-data-api-oa3.yaml
Lines 1396 to 1403 in 7ab761e
Actual behavior
The
offsetparameter is based on1. Passing0is automatically converted into1in the API. This results in duplicate response data when the client is counting up$offset++, as the client is first passing0then1.The
offsetparameter indicates the "page" to retrieve, chunked bylimit.